package com.tanhua.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.manage.domain.AnalysisByDay;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface AnalysisByDayMapper extends BaseMapper<AnalysisByDay> {

    /*@Select("select sum(num_active) from tb_analysis_by_day where record_date BETWEEN #{start} and #{end} ")
    public Long findNumActiveByDate(@Param("start") String start, @Param("end") String end);


    @Select("SELECT * FROM `tb_analysis_by_day` WHERE record_date>=#{sd} AND record_date<=#{ed};")
    List<AnalysisByDay> statistics(String sd, String ed);*/

    @Select("select sum(num_active) from tb_analysis_by_day where record_date BETWEEN #{start} and #{end} ")
    public Long findNumActiveByDate(@Param("start") String start, @Param("end") String end);

    @Select("select * from tb_analysis_by_day where record_date between #{sdTime} and #{edTime}")
    List<AnalysisByDay> getAnalysisByDay(@Param("sdTime") String sdTime,@Param("edTime") String edTime);

    // AnalysisByDay lastDay(Date created);
}